﻿@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<dynamic>
              
@{
    Layout = "_Layout.cshtml";
}
              
@section breadcrumbs
{
    <div class="breadcrumbs" id="breadcrumbs">
        <script type="text/javascript">try { ace.settings.check('breadcrumbs', 'fixed') } catch (e) { }</script>
        <ul class="breadcrumb">
            <li>
                <i class="icon-home home-icon"></i>
                <a href="/console">控制台</a>
            </li>
            <li>
                <i class="icon-gears"></i>
                系统管理
            </li>
            <li class="active"><a href="/admin">管理员设置</a></li>
        </ul><!-- .breadcrumb -->
        @Html.Partial("_Version")
    </div>
}

<div class="page-content">
    <div class="page-header">
        <h1>
            用户管理
        </h1>
    </div>

    <div class="hr dotted hr-double"></div>

    <h4 class="pink" style="text-align: right;">
        <a class="btn btn-sm btn-primary" href="/admin/add">
            <i class="icon-plus align-top bigger-100"></i>
            添加用户
        </a>
    </h4>

    <div class="hr dotted hr-double"></div>

    <div class="row">
        <div class="col-xs-12">
            <!-- PAGE CONTENT BEGINS -->

            <div class="row">
                <div class="col-xs-12">

                    <div class="table-responsive">
                        <table id="sample-table-2" class="table table-striped table-bordered table-hover">
                            <thead>
                                <tr>
                                    <th style="display: none;"></th>
                                    <th class="center">Id</th>
                                    <th class="center">管理员账号</th>
                                    <th class="center">管理员昵称</th>
                                    <th class="center">管理员邮箱</th>
                                    <th class="center">管理员状态</th>
                                    <th></th>
                                </tr>
                            </thead>

                            <tbody>
                                @foreach (var item in Model)
                                {
                                    <tr>
                                        <th style="display: none;"></th>
                                        <td class="center">@item.Id</td>
                                        <td class="center">@item.Account</td>
                                        <td class="center">@item.Nick</td>
                                        <td class="center">@item.Email</td>
                                        <td class="center">
                                            @if (item.Status == 1)
                                            {
                                                <span class="label label-sm label-success">启用</span>
                                            }
                                            else
                                            {
                                                <span class="label label-sm label-warning">禁用</span>
                                            }
                                        </td>

                                        <td>
                                            <div class="visible-md visible-lg hidden-sm hidden-xs action-buttons">

                                                <a class="green tooltip-success" data-rel="tooltip" title="编辑" href="/admin/edit/@item.Id">
                                                    <i class="icon-pencil bigger-130"></i>
                                                </a>

                                                <a class="red tooltip-error" data-rel="tooltip" title="删除" href="javascript:;" onclick="Delete(@item.Id)">
                                                    <i class="icon-trash bigger-130"></i>
                                                </a>
                                            </div>

                                            <div class="visible-xs visible-sm hidden-md hidden-lg">
                                                <div class="inline position-relative">
                                                    <button class="btn btn-minier btn-yellow dropdown-toggle" data-toggle="dropdown">
                                                        <i class="icon-caret-down icon-only bigger-120"></i>
                                                    </button>

                                                    <ul class="dropdown-menu dropdown-only-icon dropdown-yellow pull-right dropdown-caret dropdown-close">

                                                        <li>
                                                            <a href="/admin/edit/@item.Id" class="tooltip-success" data-rel="tooltip" title="编辑">
                                                                <span class="green">
                                                                    <i class="icon-edit bigger-120"></i>
                                                                </span>
                                                            </a>
                                                        </li>

                                                        <li>
                                                            <a href="javascript:;" onclick="Delete(@item.Id)" class="tooltip-error" data-rel="tooltip" title="删除">
                                                                <span class="red">
                                                                    <i class="icon-trash bigger-120"></i>
                                                                </span>
                                                            </a>
                                                        </li>
                                                    </ul>
                                                </div>
                                            </div>
                                        </td>
                                    </tr>
                                }
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>

        </div>

    </div>

</div>

@section PageScript{

    <script src="~/Content/assets/page/admin.js" type="text/javascript"></script>

}